package com.example.baiduai.factory;

import com.example.baiduai.control.Controller;

/**
 * @author wangyizhu
 * @version "1.8.0_131"
 * @email 2641956765@qq.com
 * @desc:该静态方法用于反射实例化一个控制器
 * @Time 2022/09/23 15:17
 */
public class ControllerFactory {
    public static Controller newInstance(Class classes){
      try {
          return (Controller) classes.newInstance();
      }catch (InstantiationException e){
          throw new RuntimeException(e);
      }catch (IllegalAccessException e){
          throw new RuntimeException(e);
      }
    }
}
